package com.gjs.cd.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.gjs.cd.pojo.entity.Code;
import com.gjs.cd.pojo.vo.CodeVo;
import com.gjs.common.pojo.dto.request.PageQuery;
import com.gjs.common.pojo.dto.response.ListPageRsp;
import org.apache.ibatis.annotations.Param;
import org.springframework.scheduling.annotation.Async;

import java.util.List;

/**
 * @author zhongwenguang
 * @date 2022-3-9 18:03
 */
public interface ICodeService extends IService<Code> {

    //新增激活码
    int add(Long batchId,int num);

    //查询某一批次的激活码
    IPage<CodeVo> queryBatch(PageQuery pageQuery, Long batchId);

    //查询
    Code queryByCode(@Param("tableName") String tableName, @Param("code")String code);

    //查询所有激活码表名称
    List<String> queryTable();

    //通过codeId获取List<Code>,多表查询结果合并
    List<Code> queryByTableNames(@Param("tableNameList") List<String> tableNameList,@Param("ids") List<Long> ids);

    //通过activation_code_id批量查询
    List<Code> queryCodeList(@Param("tableName") String tableName,@Param("ids") List<Long> ids);


}
